<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html>
<head>
  <title>我的预约</title>
  <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css">
</head>
<body>
<%@ include file="../header.jsp" %>
<div class="container">
  <h2>我的预约</h2>
  <div class="search-container">
    <form action="${pageContext.request.contextPath}/labReservations?action=search" method="post">
      <input type="hidden" name="action" value="search">
      <input type="text" name="keyword" placeholder="搜索预约" value="${fn:escapeXml(keyword)}">
      <button type="submit">搜索</button>
    </form>
  </div>
  <table class="user-table">
    <thead>
    <tr>
      <th>预约ID</th>
      <th>实验室ID</th>
      <th>预约日期</th>
      <th>开始时间</th>
      <th>结束时间</th>
      <th>用途</th>
      <th>状态</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${reservations}" var="reservation">
      <tr>
        <td>${reservation.reservationId}</td>
        <td>${reservation.labId}</td>
        <td>${reservation.reservationDate}</td>
        <td>${reservation.startTime}</td>
        <td>${reservation.endTime}</td>
        <td>${reservation.purpose}</td>
        <td>${reservation.status}</td>
      </tr>
    </c:forEach>
    </tbody>
  </table>
</div>
</body>
</html>